This invention relates in general to digital image rescaling, and more particularly to a method and apparatus for increasing the sharpness and uniformity of a rescaled image.
Image rescaling or image resizing is a frequently required function in digital image processing systems. This function utilizes digital filtering of input picture elements (pixels) to generate output pixels. Because the eye is sensitive to changes in signal phase, the most commonly used filters in image rescaling are linear phase Finite Impulse Response (FIR) filters. The rescaling process is achieved by varying the input signal sampling rate. More specifically, the sampling rate is increased in order to enlarge an image, or decreased in order to shrink an image.
Variable resealing factors may be obtained by first upsampling the signal at a fixed sampling rate, and then downsampling the upsampled signal at a different rate to achieve the required (variable) image rescaling factor. Usually, the first upsampling step utilizes an upsampling factor of 32 or 64. For efficient implementation, the upsampling and downsampling operations are normally combined, and only one sample is calculated for output, all other samples being ignored.
For a digital input signal x[n], the Fourier transform is
X(exe2x88x92jxcfx89)=xcexa3k=0x[k]ejkxcfx89
and for a given finite impulse filter h[n], its Fourier transform is
H(exe2x88x92jxcfx89)=xcexa3k=0Nxe2x88x921h[k]exe2x88x92jkxcfx89
In the upsampling stage, Mxe2x88x921 zeros are inserted between any subsequent two input samples, and the Fourier transform of the resultant upsampled signal is X(exe2x88x92jMxcfx89). The filter h[n] may be split into M filter phases, where the kth filter phase is hk[n]=h[k+Mn], and the Fourier transform is
Hk(exe2x88x92jxcfx89)=xcexa3p=0h[k+Mp]ejpxcfx89
Splitting of the filter into phases, as discussed above, is possible only in the case of an integer upsampling factor.
The result of the convolution between the input signal and the filter h[n] is y[n] with the following Fourier transform
Y(exe2x88x92jxcfx89)=X(exe2x88x92jMxcfx89)xcexa3p=0Mxe2x88x921Hk(exe2x88x92jMxcfx89)exe2x88x92jpxcfx89
Y(exe2x88x92jxcfx89)=xcexa3p=0Mxe2x88x921(XHk)(exe2x88x92jMxcfx89)exe2x88x92jpxcfx89
Any output sample is a result of a convolution between the input signal, and a specific filter phase. For each upsampled input, there are M output samples which are the result of convolution of the input sample with all of the M filter phases. The M outputs are equally spaced over a time interval which corresponds to the period of the input sampling. When an output sample is required, its position is calculated, and the appropriate phase filter is selected for convolution with the input (the chosen phase being the closest to the physical location of the output sample).
Thus, in general, the foregoing rescaling process steps may be simplified as follows: (1) select the input data, (2) determine the phase of the filter, and (3) calculate the convolution between the data and the previously determined filter phase. Traditionally, the input data and the filter phase are calculated based on the position of the output sample. It is an object of an aspect of the invention to determine the optimum filter phase in order to obtain a rescaled image with high contrast.
According to one prior art method for increasing image contrast, peaking filters are used to boost the high frequencies. However, at low rescale factors, the boosting has little effect. Another method detects short transition times in the signal and artificially decreases those times by taking, for example, the first derivative of the signal. Unfortunately, this technique is not appropriate for graphics applications where the signal usually varies from minimum to maximum in a single step.
The following patents are relevant as prior art relative to the present invention:
According to the present invention, a method and apparatus are provided for improving the contrast of an image through the rescaling process. Traditionally, the rescaled output image is generated by sampling the input signal according to a uniform grid. When the ratio of the input and output sampling rates is not an integer, the processing is no longer spatially invariant. Thus, a given input detail becomes rescaled differently depending on the position of that detail in the input signal. Occasionally, an input detail is rescaled perfectly, but more often than not such details are poorly rescaled.
The method of the present invention detects those cases where uniform sampling fails to provide a good contrast, and through the use of non-uniform sampling, improves the local contrast.